home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / shape.lha / shape / myshape.c < prev    next >
Text File  |  1993-08-08  |  610b  |  25 lines

  1. include "myshape.h"
  2.  
  3. yshape::myshape(point a, point b) : (a,b)
  4.  
  5.    int ll = neast().x - swest().x + 1;
  6.    int hh = neast().y - swest().y + 1;
  7.    l_eye = new line(point(swest().x + 2, swest().y + hh * 3 / 4) , 2);
  8.    r_eye = new line(point(swest().x + ll - 4, swest().y + hh * 3 / 4), 2);
  9.    mouth = new line(point(swest().x + 2, swest().y + hh / 4) , ll - 4);
  10.  
  11.  
  12. oid myshape:: draw()
  13.  
  14.    rectangle::draw();
  15.    put_point(point((swest().x + neast().x) / 2, (swest().y + neast().y) / 2));
  16.  
  17.  
  18. oid myshape:: move(int a, int b)
  19.  
  20.    rectangle::move(a,b);
  21.    l_eye->move(a,b);
  22.    r_eye->move(a,b);
  23.    mouth->move(a,b);
  24.  
  25.